﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Comment_json.aspx.cs" Inherits="newBlog.CenterInc.view_json.Comment_json" %>

<%@ Import Namespace="newBlog.CenterInc.model" %>
<%@ Import Namespace="newBlog.CenterInc.Ctrltor" %>
<%@ Import Namespace="System.Web.Script.Serialization" %>
<% 
        Response.ContentType = "application/json";
        if (Session["user_id"] == null) {
            Response.Write("{\"error\":\"您未登录本站\"}");
            return;
        }
    string user_id = Convert.ToInt32(Session["user_grade"])!=1?Session["user_id"].ToString():Request.Form["user_id"]==null||Request.Form["user_id"].Length==0?"":Request.Form["user_id"];
    int page = Request.Form["page"]==null||Request.Form["page"].Length==0?0:(Convert.ToInt32(Request.Form["page"])-1)*20;
    string minTime = Request.Form["minTime"] == null||Request.Form["minTime"].Length==0? "":Request.Form["minTime"];
    string maxTime = Request.Form["maxTime"] == null||Request.Form["maxTime"].Length==0? "":Request.Form["maxTime"];
    string content = Request.Form["content"] == null||Request.Form["content"].Length==0? "":Request.Form["content"];
    string article_id = Request.Form["article_id"] == null||Request.Form["article_id"].Length==0? "" : Request.Form["article_id"];
    JavaScriptSerializer serializer = new JavaScriptSerializer();
    Comment_inc comment_Inc = new Comment_inc();
    List<Comment_ArticleDao> list = comment_Inc.MyComment_items(user_id,minTime,maxTime,content,article_id);
    int count = comment_Inc.MyComment_Count(user_id,minTime,maxTime,content,article_id);
    string json = "{\"code\":0,\"msg\":\"\",\"count\":"+count+",\"data\":"+serializer.Serialize(list)+"}";
    Response.Write(json);

    %>